package A1;

/**
 * Created by IntelliJ IDEA.
 * User: nguwi.yokyen
 * Date: Mar 24, 2011
 * Time: 3:50:34 PM
 * To change this template use File | Settings | File Templates.
 */
public class GridView {
    char[][] cell;
	ProjModel pm;
	int gridSize;
	ArrayList<Car> carArray;
	
	public GridView() {
	}
	
	public GridView(ProjModel pm) {
		this.pm = pm;
		cell = new char[pm.getGridSize()][pm.getGridSize()];
		gridSize = pm.getGridSize();
	}
	
	public void initGrid(char ch) {
		//initialize cell with '?'
		for(int i=0; i<gridSize; i++) {
			for(int j=0; j<gridSize; j++) {
				cell[i][i] = 'ch';
			}
		}	
	}
	
	public void showGrid() {
		for(int i=0; i<gridSize; i++) {
			for(int j=0; j<gridSize; j++) {
				system.out,print(cell[i][j]);
			}
				System.out.println();
		}	
	}
	
	public void buildHorlane() {
		int middle = gridSize/2;	
		
		int horLane = pm.getHorLanes();
		
		for(int i=0; i<gridSize; i++) {
			for (int c=0; c<horLane; c++);
			cell[middle+C] [1] = ' ';
			}
		}
	}
	
	public void buildVerlane () {
		int midlle = gridSize/2;
		int verLane = pm.getVerLanes();
		for (int i=0; i<gridSize; i++) {
			for (int c=0; a<verLane; c++);
			cell[i] [middle+c] = '';
		}
	}
}

public void buildCars() {
	int middle = gridSize/2;
	carArray.add(new Car(middle, middle));
	
	Car c1 = carArray.get(0);
	cell[c1.getXPos()] [c1.geyYPos()] = 'c';
}
}